//
//  BMARootViewController_iPad.m
//  Autismus
//
//  Created by Nicolas CHENG on 03/12/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import "BMARootViewController_iPad.h"

#import "BMAMemoriExoSelectLevelViewController.h"
#import "BMAIntrusExoViewController.h"
#import "BMAQuestionsExoViewController.h"
#import "BMAEmotionViewController.h"
#import "BMAPourLesParentsViewController.h"

@implementation BMARootViewController_iPad

@synthesize emotionButton;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self != nil)
    {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - IBActions

- (IBAction)memoriAction:(id)sender
{
    BMAMemoriExoSelectLevelViewController *vc = [[BMAMemoriExoSelectLevelViewController alloc] init];
    vc.title = @"Sélection du Level";
    [self.navigationController pushViewController:vc animated:YES];
}

- (IBAction)intrusAction:(id)sender
{
    BMAIntrusExoViewController *vc = [[BMAIntrusExoViewController alloc] init];
    vc.title = @"Intrus";
    
    [self.navigationController pushViewController:vc animated:YES];
}

- (IBAction)questionsAction:(id)sender
{
    BMAQuestionsExoViewController *vc = [[BMAQuestionsExoViewController alloc] init];
    vc.title = @"Questions";
    [self.navigationController pushViewController:vc animated:YES];
}

- (IBAction)emotionsAction:(id)sender
{
    BMAEmotionViewController *vc = [[BMAEmotionViewController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}

- (IBAction)parentsAction:(id)sender
{
    BMAPourLesParentsViewController *vc = [[BMAPourLesParentsViewController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];    
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"Accueil";
    
    [UIView animateWithDuration:0.5 animations:^{
        CGRect rect = self.emotionButton.frame;
        rect.origin.y -= 100; 
        self.emotionButton.frame = rect;
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.2 delay:0.95 options:UIViewAnimationCurveLinear animations:^{
            CGRect rect = self.emotionButton.frame;
            rect.origin.y += 100; 
            self.emotionButton.frame = rect;
        } completion:^(BOOL finished) {
            
        }];
    }];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
	return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

@end
